/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2022-11-14
 * Time: 14:25
 */
class MyValue {
    public int value;

}



public class TestDemo {
    public static void swap(MyValue my1,MyValue my2){
        int tmp= my1.value;
        my1.value=my2.value;
        my2.value=tmp;
    }


    public static void main(String[] args) {
            MyValue myValue1=new MyValue();
        MyValue myValue2=new MyValue();
        myValue1.value  =20;
        myValue2.value=30;
        swap(myValue1,myValue2);
        System.out.println( myValue1.value);
        System.out.println(myValue2.value);
    }
}
